package com.example.testcentral.designpattern

import android.util.Log

/**
 * @description
 * @param
 * @return
 * @author zhangzhenzhong
 * @time
 */
class DoubleCheckLockingSingleton private constructor() {
    companion object {
        private var instance: DoubleCheckLockingSingleton? = null
        fun getInstance(): DoubleCheckLockingSingleton {
            if (instance == null) {
                synchronized(DoubleCheckLockingSingleton::class.java) {
                    if (instance == null) {
                        instance = DoubleCheckLockingSingleton()
                    }
                }
            }
            return instance!!
        }
    }
    open fun doSomething(){
        Log.d(javaClass.name, "doSomething: dosomething")
    }
}